<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>门店信息列表</title>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <form action="biz4sinfo/dolist" method="post" name="searchForm" id="searchForm" role="form" class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-1 control-label">版本</label>
            <div class="col-md-4">
                <d:select clazz="selectpicker" list="${sysVersions}" name="sysVersion" selected="${searchEntity.sysVersion}" ></d:select>
            </div>
            <label class="col-sm-1 control-label">部署时间：</label>
            <div class="col-sm-4">
                <input type="text" class="span1 Wdate" style="width:205px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd', maxDate:'#F{$dp.$D(\'endAddTime\')}'})" id="beginAddTime" name="beginAddTime" value="${searchEntity.beginAddTime}" placeholder="开始时间" /> 至
                <input type="text" class="span1 Wdate" style="width:205px" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd', minDate:'#F{$dp.$D(\'beginAddTime\')}'})" id="endAddTime" name="endAddTime" value="${searchEntity.endAddTime}" placeholder="结束时间" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">关键字</label>
            <div class="col-md-4">
                <div class="input-group">
                    <input type="text" class="form-control" name="keywords" value="${searchEntity.keywords}" placeholder="">
                    <div class="input-group-btn">
                        <button id="searchBtn" type="button" class="btn btn-sm btn-info"><i class="fa fa-search"></i> 搜索</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="row">
        <div class="col-md-10">
            <p>
                <button id="export" type="button" url="biz4sinfo/exportVersion" class="btn btn-sm btn-pink link_export" style="margin-left: 2px">导出</button>
            </p>
        </div>
    </div>

    <table id="table_data" class="table table-striped table-bordered table-hover">
        <thead>
        <tr>
            <th class="center td-checkbox" width="5%">
                <label><input type="checkbox" class="check-all ace" data-tableid="table_data" /><span class="lbl"></span></label>
            </th>
            <th width="10%">经销商代码</th>
            <th width="10%">经销商名称</th>
            <th width="10%">系统版本</th>
            <th width="10%">部署时间</th>
            <th width="10%">备注</th>
            <th width="10%">更新记录</th>
        </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>
<!-- 返回顶部  -->
<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
        var table = $("#table_data").dataTable({
            ajax: function(data, callback, settings){
                tableAjax($("#searchForm"),data, callback, settings);
            },
            //列表表头字段
            columns: [
                mainConfig.checkboxColumn,
                { "data": "cord",name:"CORD",orderable:false },
                { "data": "name",name:"NAME",orderable:false },
                { "data": "sysVersionStr",name:"SYS_VERSION",orderable:false },
                { "data": "upgradeTimeStr",name:"upgrade_time",orderable:true },
                { "data": "versionRemark",name:"version_remark",orderable:false },
                { "data": "action",
                    "render": function ( data, type, row, meta ) {
                        var A = "<a onclick=\"handlerShow('" + row.cord + "');\">查看</a>";
                        return A;
                    },orderable:false
                }
        ]
    }).api();

        //查询条件
        $("#searchForm").submit(function(){
            table.ajax.reload();
            return false;
        });

    });


    // 版本更新记录查看
    function handlerShow(code){
        var layerIndex = layer.open({
            title: "版本更新记录查看",
            type: 2,
            content: "/bizVersionHistory/list/"+ code,
            area: [1100+"px", 700+"px"],
        });
    }
</script>
<!-- script end -->
</body>
</html>